package com.minelx.statementplus.ui.form.service.tablemapping;

import com.alibaba.fastjson.JSONObject;

import java.util.HashSet;
import java.util.Set;

public class TableMapping implements ITableMapping {
	private final JSONObject mapping;

	public TableMapping(JSONObject mapping) {
		this.mapping = mapping;
	}

	@Override
	public JSONObject customSql() {
		return mapping.getJSONObject("customSql");
	}

	@Override
	public Set<String> fieldTables() {
		return new HashSet<>(mapping.getJSONArray("fieldTables").toJavaList(String.class));
	}
}
